/*
 * @Description:测试类
 * 
 * @Author: rendc
 * 
 * @Date: 2025-08-11 14:06:04
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-08-11 14:39:30
 */

import java.util.ArrayList;
import java.util.Collection;

public class StudentTest {

  public static void main(String[] args) {
    // System.out.println("hello");
    // 创建一个集合对象，
    // 用于存放学生类对象
    Collection<Student> coll = new ArrayList<Student>();
    // 创建两个学生对象
    Student s1 = new Student("zs", 18);
    Student s2 = new Student("ls", 20);
    Student s3 = new Student("ls", 20);
    coll.add(s1);
    coll.add(s2);
    // coll.add(s3);
    // coll.add(s1);
    System.out.println("coll.size():" + coll.size()); // 2
    System.out.println("coll:" + coll);
    boolean flag = coll.contains(s3); // s1 == s3 s2 == s3
    System.out.println("coll.contains(s3):" + flag); // true或者false取决于equals方法有无重写
    coll.remove(s3);
    System.out.println("coll.size():" + coll.size()); // 2
    // System.out.println("coll:" + coll);
  }
}